﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompilerLib.Scanner
{
    /// <summary>
    /// 将正则表达式转换成其他模型
    /// </summary>
    /// <typeparam name="T">模型类型</typeparam>
    public abstract class RegularExpressionConverter<T>
    {
        public T Convert(RegularExpression exp)
        {
            return exp.Accept(this);
        }
        public abstract T ConvertSymbol(SymbolExpression exp);
        public abstract T ConvertEmpty(EmptyExpression exp);
        public abstract T ConvertAlternation(AlternationExpression exp);
        public abstract T ConvertConcatenation(ConcatenationExpression exp);
        public abstract T ConvertKleeneStar(KleeneStarExpression exp);
    }
}
